package com.mmall.common;

import com.google.common.collect.Sets;

import java.util.Set;

/**
 * Created by Administrator on 2017/5/24 0024.
 */
/*
Const ：常量，常数
 */
public class Const {

    public static final String CURRENT_USER = "currentUser";

    public static final String EMAIL = "email";
    public static final String USERNAME = "username";

    //如果使用枚举显得过于繁重。（小技巧）通过内部接口类把常量进行分组
    public interface Role {
        int ROLE_CUSTOMER = 0;//普通用户
        int ROLE_ADMIN = 1;//管理员
    }

    public interface ProductListOrderBy{
        //使用SET而不是List 是因为SET实现contains方法的复杂度是'O'1 而List是'O'n
        Set<String > PRICE_ASC_DESC= Sets.newHashSet("price_desc","price_asc");
    }


    public enum productStatusEnum{
        ON_SALE(1,"在线");
        private String value;
        private int code;
        productStatusEnum(int code,String value){
            this.code=code;
            this.value=value;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }




    }























}
